package pers.cj.pdos.service;

import pers.cj.pdos.entity.*;
import com.baomidou.mybatisplus.extension.service.IService;
import pers.cj.pdos.vo.BorrowInVo;
import pers.cj.pdos.vo.InGoodsVo;

import java.util.Date;
import java.util.List;

/**
 * <p>
 * 借入单后处于待入库状态，归还状态为未归还状态，等进行进货或者归还后，则规范状态为已归还。 服务类
 * </p>
 *
 * @author chenj
 * @since 2019-11-04
 */
public interface IBorrowInService extends IService<BorrowIn> {

    boolean checkNo(String no, String companyId);
    boolean checkClose(BorrowIn borrowIn);

    void insert(BusinessSet businessSet, BorrowIn borrowIn, List<BorrowInGoods> borrowInGoodsList, List<GoodsSn> goodsSnList, List<GoodsSnLog> goodsSnLogList);

    void close(BorrowIn borrowIn, BusinessSet businessSet);

    List<BorrowInVo> listVo(String companyId,
                            Integer page,
                            Integer limit,
                            Boolean close,
                            String search,
                            String no,
                            String goodsName,
                            String remark,
                            String provider,
                            Date makeTime1,
                            Date makeTime2,
                            String storeId,
                            String userStoreId,
                            String userId,
                            Date date1,
                            Date date2,
                            String houseId,
                            String makeUserId,
                            Integer inStatus);

    long count(String companyId,
               Boolean close,
               String search,
               String no,
               String goodsName,
               String remark,
               String provider,
               Date makeTime1,
               Date makeTime2,
               String storeId,
               String userStoreId,
               String userId,
               Date date1,
               Date date2,
               String houseId,
               String makeUserId,
               Integer inStatus);

    List<BorrowInVo> listVoByIds(List<String> ids);

    BorrowInVo getVoById(String id);
}
